# -*- coding: utf-8 -*-            
# @Author : chenliang
# @Time : 2024/1/5 13:27
from lib2to3.pgen2 import driver

from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains
from datetime import datetime


class ProductComputingLocatorRos:



   """
   Resource Orchestration Service管理控制页
   """
   #iframe
   iframe_resource_orchestration_service = (By.CSS_SELECTOR,'[id="hj_container"]')
   #判断进入Resource Orchestration Service
   if_enter_resource_orchestration_service_page = (By.XPATH,'//*[@id="icestarkNode"]/div[1]/header/section/section[1]/section[1]/div/div[1]/div')
   #判断页面包含Stack ID/Name
   #if_stack_id = (By.XPATH,'//*[@id="icestarkNode"]/div[2]/div/div[2]/div[1]/div[2]/div[1]/div[1]/table/thead/tr/th[1]/div/span[1]')
   #if_stack_id = (By.CSS_SELECTOR,'#icestarkNode > div:nth-child(2) > div > div:nth-child(2) > div.next-table.next-table-medium.only-bottom-border.next-table-lock.next-table-stickylock.next-table-wrap-empty.next-table-ping-right > div.next-table-inner > div.next-table-header > div.next-table-header-inner > table > thead > tr > th.next-table-cell.next-table-header-node.next-table-fix-left.next-table-fix-left-last > div > span.teamix-typography.teamix-typography-ellipsis')
   # 判断页面包含Organization
   if_stack_org = (By.XPATH,'(//div[@class="next-table-cell-wrapper"])[4]')
   # 判断页面包含Resource Set
   if_stack_resset = (By.XPATH,'(//span[@class="teamix-typography teamix-typography-ellipsis"])[3]')
   # 判断页面包含Status
   if_stack_status = (By.XPATH,'(//div[@class="next-table-cell-wrapper"])[6]')
   # 判断页面包含Rollback on Failure
   if_stack_rollback = (By.XPATH,'(//span[@class="teamix-typography teamix-typography-ellipsis"])[4]')
   # 判断页面包含Timeout Period
   if_stack_timeout = (By.XPATH,'(//span[@class="teamix-typography teamix-typography-ellipsis"])[5]')
   # 判断页面包含Status description
   if_stack_status_desc = (By.XPATH,'(//span[@class="teamix-typography teamix-typography-ellipsis"])[6]')
   # 判断页面包含Created At
   if_stack_created = (By.XPATH,'(//div[@class="next-table-cell-wrapper"])[10]')
   # 判断页面包含Updated At
   if_stack_updated = (By.XPATH,'(//div[@class="next-table-cell-wrapper"])[11]')
   # 判断页面包含Actions
   if_stack_actions = (By.XPATH,'(//span[@class="teamix-typography teamix-typography-ellipsis"])[7]')

   """
   创建stacks
   """
   #点击创建按钮
   click_create_stack = (By.XPATH,'//*[@id="icestarkNode"]/div[2]/div/div[1]/a/span')
   #选择resource_set输入框
   input_resource_set = (By.XPATH,'//*[@id="icestarkNode"]/div/div[2]/div[1]/div/div[2]/div/form/div/div[2]/div/div/div[2]/div[1]/div/div[1]/div[1]/span/span[1]')
   #选择resource_set的值
   select_resource_set_value = (By.XPATH,'/html/body/div[4]/div/ul/li/div/span')
   #选择template
   select_template = (By.XPATH,'//*[@id="templateType"]/label[1]/span[1]/input')
   #输入template
   iframe_input_template = (By.CSS_SELECTOR, '[id="hj_container"]')
   input_template = (By.XPATH, '//*[@id="template"]/div[2]/div/div[5]/div')
   #点击下一步
   click_next = (By.XPATH,'//*[@id="icestarkNode"]/div/div[3]/div/button[2]/span')
   #输入name
   input_name = (By.XPATH,'//*[@id="stackName"]')
   #第二次点击下一步
   second_click_next = (By.XPATH,'//*[@id="icestarkNode"]/div/div[3]/div/button[2]/span')
   #第三次点击下一步
   third_click_next = (By.XPATH,'//*[@id="icestarkNode"]/div/div[3]/div/button[2]/span')
   #点击创建提交stack
   click_create_succ = (By.XPATH,'//*[@id="icestarkNode"]/div/div[3]/div/button[2]/span')


   """
   更新stack
   """
   #点击更新按钮
   click_update = (By.XPATH, '//*[@id="icestarkNode"]/div[2]/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr/td[10]/div/div/div/div[2]/button/span')
   #输入template
   iframe_input_template = (By.CSS_SELECTOR, '[id="hj_container"]')
   input_template = (By.XPATH, '//*[@id="template"]/div[2]/div')

   """
   删除stacks
   """
   #点击删除按钮
   click_delete = (By.XPATH, '//*[@id="icestarkNode"]/div[2]/div/div[2]/div[1]/div[2]/div[2]/table/tbody/tr[1]/td[10]/div/div/div/div[1]/button/span')
   #确认删除
   ensure_delete = (By.XPATH, '/html/body/div[5]/div[2]/div/div[3]/button[2]')







